/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package wang.unclecat.dataability.alarm.list_ui;

import ohos.aafwk.ability.AbilitySlice;
import ohos.agp.components.Component;
import ohos.mp.metadata.binding.metadata.MetaData;
import wang.unclecat.dataability.alarm.metadata.ClockRowMetaData;
import wang.unclecat.dataability.metadatabinding.AlarmrowMetaDataBinding;

/**
 * A row item of Alarm ListContainer. For the item layout, see: src/main/resources/base/layout/alarm_row.xml.
 *
 * @since 2021-05-15
 */
public class AlarmRow extends AbsRow<ClockRowMetaData> {

    public AlarmRow(AbilitySlice context, MetaData clockMeta) {
        super(context, clockMeta);
    }

    public Component createComponent() {
        // bind the metadata with the Alarm row item component.
        AlarmrowMetaDataBinding metaBinding = AlarmrowMetaDataBinding.createBinding(context,  clockMeta);
        Component comp = metaBinding.getLayoutComponent();
        comp.setTag(metaBinding);
        return comp;
    }


}
